<template>
  <div>
    <h6>404 Not Found</h6>
    <div @click="$router.go(-1)" class="goBack">将在 {{num}} 秒后返回</div>
  </div>
</template>

<script>
export default {
    data () {
        return {
            num: 3
        }
    },
    mounted () {
        setInterval(() => {
            this.num--
        }, 1000)
    },

    methods: {

    },
    watch: {
        num: {
            handler() {
                if (this.num === 0) {
                    this.$router.go(-1)
                }
            },
            immediate: true
        }
    }
}
</script>

<style scoped >
h6{
  color: lightcoral;
}
.goBack{
  font-size: 26px;

}
</style>
